package br.com.iswe.gwt.util.client;

import java.util.ArrayList;
import java.util.List;

public abstract class QueryListener {
	
	protected List filters = new ArrayList();
	
	protected abstract void executeImpl(QueryInfo queryInfo);
	
	public void execute(QueryInfo queryInfo){
		for (int i = 0; i < filters.size(); i++) {
			QueryListener queryListener = (QueryListener)filters.get(i);
			queryListener.execute(queryInfo);
		}
		executeImpl(queryInfo);
	}
	
	public void addQueryListener(QueryListener queryListener){
		filters.add(queryListener);
	}
	
}
